﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class erhverv : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        loadModules();
        loadContent();
    }
    protected void loadModules() {
        phd_menu.Controls.Clear();
        UserControl uc_menu = (UserControl)LoadControl("./modules/menu.ascx");
        phd_menu.Controls.Add(uc_menu);

        phd_banner.Controls.Clear();
        UserControl uc_banner = (UserControl)LoadControl("./modules/banner_sub.ascx");
        phd_banner.Controls.Add(uc_banner);
    
    }
    protected void loadContent()
    {
        string id = "3";
        string query = "SELECT * FROM mwc_content WHERE id = " + id;
        SqlConnection sc = new SqlConnection(ConfigurationSettings.AppSettings["mwc_con"]);
        sc.Open();
        SqlCommand scmd = new SqlCommand(query,sc);

        SqlDataReader sdr = scmd.ExecuteReader();
        while (sdr.Read()) {
            article_fulltext.Text = sdr["fulltext"].ToString();
            article_title.Text = sdr["title"].ToString();
        }


    }
}
